<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title>Twin Tulipware</title>
        <meta name="keywords" content="" />
        <meta name="description" content="" />
        <?php $this->load->helper('HTML');
        echo link_tag('css/style2.css');
		echo link_tag('images/favicon.ico','shortcut icon','image/x-icon');
?></head>
<div id="page1">    <body>
        <div id="wrapper">
            <?php $this->load->view('admin_views/header'); ?><hr />
        </div>
        <div id="page">
            <div id="page-bgtop">
                <div id="content">
                    <div class="post">
                        <h2 class="title">Daftar Manager </h2>

                        <form method="post" action="<?php echo $form_action?>">
                            <table>
                                <!--<tr>
                                    <td>
                                        Cari Berdasarkan Nama Manager &nbsp; <input name="cari_nama" value="" size="30" type="text">

                                    </td>
                                </tr>-->
                                <tr>
                                    <td>
                                        Cari Berdasarkan Bulan &nbsp; <?php echo $combo_bulan?>
                                        <input type="text" size="5" name="tahun" id="tahun" value="<?php echo date('Y')?>">
                                        <input type="submit" name="submit" value="Cari">
                                    </td>
                                </tr>
                            </table>
                        </form>

                        <table width="100%" border="0" cellpadding="1" cellspacing="1" id="data" align="center">

                            <thead>
                                <?php if(!empty($bulan)):?>
                                <tr>
                                    <td colspan="3">
                                        <?php echo anchor('./assets/pdfs/cm.pdf','Export Pdf',array('class' => 'update', 'target'=>'_blank')) ?>
                                    </td>
                                </tr>
                                <?php else:?>
                                <tr>
                                    <td  colspan="3">
                                        <?php echo anchor('calon_manager/cetak_manager/'.$bulan,'Export Pdf',array('class' => 'update', 'target'=>'_blank')) ?>
                                    </td>
                                </tr>
                                
                                <?php endif;?>
                                <tr  align="center" class="table" >
                                    <th >No</th>
                                    <th >Nama Manager</th>
                                    <th>Mother Manager</th>
                                    <th >Unit Baru</th>
                                    <th >Manager Khusus</th>
                                    <th>Bulan</th>
                                    <th>Sales</th>
                                    <th>PV</th>
                                    <th>Kota</th>
                                    <th >Action</th>

                                </tr>
                            </thead>
                            <tbody>

                                <!-- ============isi ============ -->

                                <?php
                                if(!empty($pra_cm)) {
                                    $i=1;
                                    foreach($pra_cm as $m) :
                                         if($m->cm_khusus==1){
                                        $c = "Satu Bulan";
                                    }elseif($m->cm_khusus==2){
                                        $c = "Dua Bulan";
                                    }else{

                                        $c = "Tiga Bulan";
                                    }
                                        ?>
                                <tr class='data' align='center'>
                                    <td ><?php echo $i++; ?></td>
                                    <td align='left'>&nbsp;<?php echo $m->strnama_dealer; ?></td>
                                    <td align='left'>&nbsp;<?php echo $m->strnama_upline; ?></td>
                                    <td align='left'>&nbsp;<?php echo $m->strnama_unit; ?></td>
                                    <td align='left'>&nbsp;<?php echo $c; ?></td>
                                    <td align='left'>&nbsp;<?php echo date('F',strtotime($m->tanggal)); ?></td>

                                    <td align='left'>&nbsp;<?php echo $m->total_omset; ?></td>
                                    <td align='left'>&nbsp;<?php echo $m->total_pv; ?></td>
                                    <td align='left'>&nbsp;<?php echo $m->cabang; ?></td>
                                    <td align='left'>&nbsp;<?php if ($this->session->userdata('privilege')== 1){ echo anchor ('calon_manager/batal_manager/'.$m->strkode_dealer, 'Batal', array('onClick' =>"return confirm ('Apakah Anda yakin akan menghapus data ')")); } ?>
									<?php //echo anchor('calon_manager/batal_manager/'.$m->strkode_dealer,'Batal',array('class' => 'update')) ?></td>

                                </tr>
                                    <?php
                                    endforeach;
                                }else {
                                    ?>
                                <tr>
                                    <td colspan="6" align="center">
                                        No Data Display
                                    </td>
                                </tr>
                                    <?php } ?>

                            </tbody>
                        </table>
                    </div>
                </div>
                <!-- end #content -->
                <?php $this->load->view('admin_views/sidebar_manager'); ?><!-- end #sidebar -->
                <div style="clear: both;">&nbsp;</div>
            </div>
        </div>
        <!-- end #page -->
        <div id="footer-bgcontent">
            <?php $this->load->view('admin_views/footer'); ?></div>
        <!-- end #footer -->

    </body>
</html>
